package com.system.common.dao.role;

import com.system.common.entity.role.Role;
import com.system.common.entity.role.RoleExample;
import java.util.List;

import com.system.common.request.role.SaveRoleReq;
import com.system.common.vo.role.AllRoleVo;
import com.system.common.vo.role.RoleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface RoleMapper {
    /**
     *
     * @mbg.generated 2020-03-02
     */
    long countByExample(RoleExample example);

    /**
     *
     * @mbg.generated 2020-03-02
     */
    int deleteByExample(RoleExample example);

    /**
     *
     * @mbg.generated 2020-03-02
     */
    int insert(Role record);

    /**
     *
     * @mbg.generated 2020-03-02
     */
    int insertSelective(Role record);

    /**
     *
     * @mbg.generated 2020-03-02
     */
    List<Role> selectByExample(RoleExample example);

    /**
     *
     * @mbg.generated 2020-03-02
     */
    int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);

    /**
     *
     * @mbg.generated 2020-03-02
     */
    int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);
    List<RoleVo> selectByPage(@Param("req") SaveRoleReq req, @Param("pageSize") Integer pageSize, @Param("offset") Integer offset);

    /**
     *  根据人员获取角色ID
     * @param pid
     * @return
     */
    List<Long> selectRoleIds( @Param("pid") Long pid);

    /**
     *  获取所有角色
     * @return
     */
    List<AllRoleVo> selectAllRole();
}